import instance from '@/utils/axios.js';

// 获取
function getArticleCategory() {
    return instance({
        url:'/admin/category/list',
        method:'get'
    })
}

// 增
function addArticleCategory(obj) {
    return instance({
        url:'/admin/category/add',
        method:'post',
        data:obj
    })
}

// 删
function deleteArticleCategory(id) {
    return instance({
        url:'/admin/category/delete',
        method:'post',
        data:{id}
    })
}

// 改
function editArticleCategory(obj) {
    return instance({
        url:'/admin/category/edit',
        method:'post',
        data:obj
    })
}


export { getArticleCategory ,addArticleCategory,deleteArticleCategory, editArticleCategory}

// 文章
// 查
function getArticle(obj) {
    return instance({
        url:'/admin/article/query',
        method:'get',
        params:obj
    })
}
// 增
function addArticle(obj) {
    return instance({
        url:'/admin/article/publish',
        method:'post',
        data:obj
    })
}

// 改
function editArticle(obj) {
    return instance({
        url:'/admin/article/edit',
        method:'post',
        data:obj
    })
}

// 删
function deleteArticle(id) {
    return instance({
        url:'/admin/article/delete',
        method:'post',
        data:{id}
    })
}


export { getArticle,addArticle,editArticle,deleteArticle }